#include "smelter_shading.h"
#include "helper.h"
#include "debug.h"

typedef struct
{
    su8 curColorIndex;
    su8 speed;
} Smelter_Shading_Context;
static Smelter_Shading_Context context;
void smelter_shading_restart(Config_Mode_Shading *shading)
{
    context.curColorIndex = 0;
    context.speed = shading->speed;
}

Efct_Stage smelter_shading_process(Config_Mode_Shading *shading)
{
    su16 tmp;
    static su8 tmp2 = 0;
    context.speed = shading->speed/32;
    if (tmp2 >= (7 - context.speed))
    {
        tmp2 = 0;
        context.curColorIndex = context.curColorIndex + 1;
    }
    else
    {
        tmp2++;
    }
    for (tmp = 0; tmp < gCfgFactoryPtr->enabledDotNumber; tmp++)
    {
        helper_wheel(context.curColorIndex, &rgbStrip.colors[tmp]);
    }
    return E_PROCESS;
}
